<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/jsp/ningbo/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport"
	content="width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="default">
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="address=no;">
<title>政策法规</title>
<link rel="stylesheet" type="text/css"href="<%=request.getContextPath()%>/jsp/ningbo/css/news.css">
</head>
<body>
<input type="hidden" id="itemValId" value="166">
<input type="hidden" id="searchOrLoadId" value="load">
	<main class="body bggray"> <!-- head start -->
	<%-- <header id="header"> 
	<span><img alt="宁波人社局" src="<%=request.getContextPath()%>/jsp/ningbo/images/top_logo.png" width="35" height="35"></span>
	<h1>政策法规</h1>
	</header> <!-- head end --> 
	<div class="mt50"></div>--%>
	<!-- main start -->
	<div class="newsbox">
		<div class="policy">
			<div class="title-box">
				<ul>
					<li onclick="setThisMain(166)" class="policy_icon1 on" id="jypx"><h3>就业培训</h3></li>
					<li onclick="setThisMain(170)" class="policy_icon2" id="shbx"><h3>社会保险</h3></li>
					<li onclick="setThisMain(172)" class="policy_icon3" id="rcrs"><h3>人才人事</h3></li>
					<li onclick="setThisMain(1643)" class="policy_icon4" id="xzfy"><h3>行政复议</h3></li>
					<li onclick="setThisMain(184)" class="policy_icon5"  id="qtzc"><h3>其他政策</h3></li>
					<li onclick="setThisMain(191)" class="policy_icon6" id="zcjd"><h3>政策解读</h3></li>
				</ul>
			</div>
		</div>
		<div class="list-box rank">
			<ul id="thelist" class="rank-box on list_news2" >
				<c:if test="${not empty newsList_jypx}">
					<c:forEach var="news" items="${newsList_jypx}">
						<li onClick='javascript:window.location.href="<%=request.getContextPath()%>/nbwx/m/list_detail?docid=${news.docid}"'>
							<h3>${news.doctitle}</h3>
							<p>${news.chnlname}</p> <span>${fn:substringBefore(news.docreltime,".")}</span>
						</li>
					</c:forEach>
				</c:if>
				<c:if test="${empty newsList_jypx}">
      				暂无数据
      			</c:if>
			</ul>
		<div class="bg_gray10"></div>
		<div class="bottom_load" id="loadMore" onclick="loadMore();">点击加载更多</div>
		</div>

	</div>
	<!-- main end --> </main>
	<script type="text/javascript"src="<%=request.getContextPath()%>/jsp/ningbo/js/jquery-1.8.2.js"></script>
	<script type="text/javascript"src="<%=request.getContextPath()%>/jsp/ningbo/js/common.js"></script>
	<script type="text/javascript">
var commitFlag_A = "1";
var startNum=0;
var pageSize=15;
var noDataFlag="1";//默认是还有数据
function loadMore(){
		if(commitFlag_A!="1"){
			return "";
		}
		if(noDataFlag=="2"){
			return""
		}
		$("#loadMore").html("Loading...");
		commitFlag_A = "2";
		startNum = startNum+pageSize;
		var data = {};
		data.startNum = startNum+"";
		var showResultDataObj = $("#thelist");
		var item = $("#itemValId").val();
		$.ajax({
			url : ctxPath+'/nbwx/m/list_liebiaoMore?item='+item,
			type : 'post',
			data : data,
			dataType : 'html',
			ifModified : true,
			cache : false,
			success : function(data) {
				commitFlag_A = "1";
				data = $.parseJSON(data);
				var tempObj=eval(data.model); 
				if(tempObj.length>0){
					var htmlStr ="";
					for(var i=0;i<tempObj.length;i++){ 
						var itemInfo  = tempObj[i];
						htmlStr +="<li onClick=javascript:window.location.href='<%=request.getContextPath()%>/nbwx/m/list_detail?docid="+itemInfo.docid+"'>"; 
						htmlStr +="<h3>"+itemInfo.doctitle+"</h3>"; 
						htmlStr +="<p>"+itemInfo.chnlname+"</p>"; 	
						var docreltimeNoDot = itemInfo.docreltime.substring(0,itemInfo.docreltime.length-2);
						htmlStr +="<span>"+docreltimeNoDot+"</span>";
						htmlStr +="</li>"; 
					}
					if(tempObj.length==pageSize){
						noDataFlag="1";
						$("#loadMore").html("点击加载更多");
					}else if(tempObj.length<pageSize){
						noDataFlag="2";
						$("#loadMore").html("加载已完成!");
					}
					var searchOrLoad = $("#searchOrLoadId").val(); 
					if(searchOrLoad=="search"){
						showResultDataObj.html(htmlStr);
						$("#searchOrLoadId").val("load");
					}else{
						showResultDataObj.append(htmlStr);
					}
				}else{
					noDataFlag="2";
				}
			}
		});   	
 }
 
 function setThisMain(item){
	$("#jypx").removeClass("on");
	$("#shbx").removeClass("on");
	$("#rcrs").removeClass("on");
	$("#xzfy").removeClass("on");
	$("#qtzc").removeClass("on");
	$("#zcjd").removeClass("on");
	if(item==166){
		$("#jypx").addClass("on");
	}else if(item==170){
		$("#shbx").addClass("on");
	}else if(item==172){
		$("#rcrs").addClass("on");
	}else if(item==1643){
		$("#xzfy").addClass("on");
	}else if(item==184){
		$("#qtzc").addClass("on");
	}else if(item==191){
		$("#zcjd").addClass("on");
	}
	 startNum = -15;
	 $("#itemValId").val(item);
	 $("#searchOrLoadId").val("search");
	 noDataFlag="1";
	 loadMore(); 
 }
</script>
</body>
</html>